﻿#ifndef ALGOSETFORM_H
#define ALGOSETFORM_H

#include <QWidget>
#include "AiPtuStruct.h"
#include <QJsonObject>

namespace Ui
{
    class AlgoSetForm;
}

class AlgoSetForm : public QWidget
{
    Q_OBJECT

public:
    explicit AlgoSetForm(QString devType, QString chnid, QWidget *parent = nullptr);
    ~AlgoSetForm();

private slots:
    void initForm();

    void initCamLForm();

    void initCamFForm();

    void initARMForm();

    void initGPUForm();

    void initDZFTForm();

    void on_bt_close_clicked();

    void on_btn_draw_clicked(bool checked);

    void on_btn_cleardraw_clicked();

    void on_btn_getZoneParam_clicked();

    void on_btn_setZoneParam_clicked();

    void onAddInfo(QString info);

    void onGetBeltTearZone();

    void onSetPileCoalParam();

    void on_btn_RealTimeImage_clicked();

public:
    void onAlarmImage(WsBinHeader header, QByteArray image, AlarmExtern alarmExtern);

    void onGetZoneParam(QJsonObject obj);

    void onGetPileCoalParam(QJsonObject obj);

    void onGetBeltWidthParam(QJsonObject obj);

    void onGetCorrectZone(QJsonObject obj);

    void onSetCompareZone(int width);


signals:
    void sigdrawBeltZone(QJsonObject);

private:
    Ui::AlgoSetForm *ui;
    QString m_devType;
    QString m_chnid;
    QPoint clickPos;
    bool show_alarmExtern;
    int image_bit;
    int  realmode;

protected:
    void mousePressEvent(QMouseEvent *e);
    void mouseMoveEvent(QMouseEvent *e);

};

#endif // ALGOSETFORM_H
